<?php

namespace common\models\base;

use Yii;
use yii\db\ActiveRecord;
use yii\behaviors\TimestampBehavior;

/**
 * This is the model class for table "{{%ad_wx}}".
 *
 * @property int $id
 * @property string $account 微信号
 * @property string $qrcode 二维码
 * @property string $domain_list 跳转域名集合
 * @property string $channel 渠道标识
 * @property int $append 创建时间
 * @property int $updated 修改时间
 */
class AdWx extends \yii\db\ActiveRecord
{

    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%ad_wx}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
                [['append', 'updated'], 'integer'],
                [['account', 'qrcode','domain_list','channel'], 'string', 'max' => 255],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'account' => '微信号',
            'qrcode' => '二维码',
            'domain_list'=>'域名列表',
            'channel'=>'渠道标识',
            'append' => '创建时间',
            'updated' => '修改时间',
        ];
    }

    public function behaviors()
    {
        return [
                [
                'class' => TimestampBehavior::className(),
                'attributes' => [
                    ActiveRecord::EVENT_BEFORE_INSERT => ['append', 'updated'],
                    ActiveRecord::EVENT_BEFORE_UPDATE => ['updated'],
                ],
            ],
        ];
    }

}
